<%@page import="org.upt.dcda.db.UserEntity"%>
<%@page import="org.upt.dcda.presentation.SessionAttributes"%>
<%@ taglib prefix="stripes"
	uri="http://stripes.sourceforge.net/stripes.tld"%>
<% 
if(!SessionAttributes.isLoggedIn(request)) {
	response.sendRedirect("login.jsp");	
} else {
%>
<stripes:layout-render name="layout/default.jsp"
	pageTitle="Using A Layout">

	<stripes:layout-component name="pageTitle">
	Bookstore - account info
 	</stripes:layout-component>

	<stripes:layout-component name="html_head">

	</stripes:layout-component>

	<stripes:layout-component name="contents">
<% 
				
	 UserEntity ue = (UserEntity) session.getAttribute(SessionAttributes.USER);
		
%>
		<form action="modifyinfo" method="post">
			First Name: <input type="text" name="firstName"
				value="<%= ue.getUserFirstName() %>"><br> Last Name: <input
				type="text" name="lastName" value="<%= ue.getUserLastName() %>"><br>
			Address: <input type="text" name="address"
				value="<%= ue.getUserAddress() %>"><br> <input
				type=submit value="Save">
		</form>

		<form action="modifycredentials" method="post">
			Current Password: <input type="password" name="currentPassword"><br>
			New Password: <input type="password" name="newPassword"><br>
			<input type=submit value="Change password">
		</form>

	</stripes:layout-component>

</stripes:layout-render>
<%
}
%>